#include <stdio.h>
#define ROW  2
#define COL  2
void copy_ptr(double *target, double *source, int size){
    for (int i = 0; i < size; ++i) {
        printf("t:%p,s:%p\n", target + i, source + i);
        * (target + i) = *(source + i);
    }
}

void copy_2d(double target[][COL], double source[][COL],int x);

int main() {
    double source[2][2] = (double[2][2]){{1.0, 2.0}, {4.0, 3.0}};
    double target[2][2];

    printf("%p,%p,%p,%p\n", source[0], source[0] + 1, source[1], source[1] + 1);
    printf("%p,%p,%p,%p\n", target[0], target[0] + 1, target[1], target[1] + 1);
    copy_2d(target, source,2);
    return 1;
}

void copy_2d(double target[][COL], double source[][COL],int x) {
    for (int i = 0; i < x; ++i) {
        copy_ptr(target[i], source[i], ROW);
    }
}